package com.itheima.springbootssm.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.itheima.springbootssm.dao.UserDao;
import com.itheima.springbootssm.pojo.User;
import com.itheima.springbootssm.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserDao userDao;
    @Override
    @Transactional
    public List<User> findAll() {
        IPage<User> page = new Page(1,2);
        IPage<User> selectPage = userDao.selectPage(page, null);


        List<User> users = userDao.selectList(null);
        return users;
    }
}
